<template>
	<view id="blance-detail header-top-margin">
		<!-- <v-title>{{titleType == 1?'提币成功':'划转成功'}}</v-title> -->
		<header-back :headerTitle="'兑换成功'"></header-back>
		
		<view class="content-detail ">
			<view class="success-box">
				<image src="/static/icon/icon_succcess_01.png" class="suc-icon" mode=""></image>
				<view class="suc-title">+{{titleType == 1? detailObj.money : credit_log.money}} {{titleType == 1?'USDT':'积分'}}</view>
			</view>
			<view class="row-box">
				<view class="row-wrap" >
					<view class="name">交易类型</view>
					<view class="num">{{detailObj.title}}</view>
				</view>
				<view class="row-wrap" >
					<view class="name">{{titleType == 1?'消耗RP':'消耗USDT'}}</view>
					<view class="num">{{titleType == 1? credit_log.money : detailObj.money}} {{titleType == 2?'USDT':'积分'}}</view>
				</view>
				<view class="row-wrap" >
					<view class="name">交易时间</view>
					<view class="num">{{detailObj.create_time}}</view>
				</view>
			</view>
			<view class="content-btn">
				<Button btnText="继续兑换" @btnClick="againTo()" ></Button>
			</view>
		</view>
		
	</view>
</template>

<script>
	import headerBack from '@/components/headerBack.vue'
	import Button from '@/components/buttom.vue'
export default {
	data() {
		return {
			titleType: 1,
			cid: '',
			detailObj: {},
			credit_log: {},
		};
	},
	onLoad(e) {
		this.titleType = e.type?e.type:1;
		this.cid = e.cid?e.cid:'';
		this.getDetail();
	},
	components: {
		headerBack,
		Button
	},
	onShow() {

	},
	methods: {
		// 详情
		getDetail(){
			this.$api.sendRequest({
				url: '/api/wallet/exchangeLogOne',
				data: {id: this.cid},
				method: 'get',
				success: res=>{
					if(res.code == 0 ){
						this.detailObj = res.data;
						this.credit_log = res.data.credit_log;
					}else {
						this.$util.showToast({title: res.message})
					}
				}
			})
		},
		// 再一次
		againTo(){
			uni.redirectTo({
				url: `/pages/member/blance/points/apply?type=${this.titleType}`
			})
		},
	}
};
</script>

<style scoped lang="scss">
	.content-detail {
		width: 100%;
		padding: 0px 32rpx;
		box-sizing: border-box;
	}
	.success-box {
		padding: 58upx 0px;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		font-size: 36upx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #292929;
		border-bottom: 2upx solid rgba($color: #fff, $alpha: 0.12);
		.suc-icon {
			width: 120upx;
			height: 120upx;
			margin-bottom: 40upx;	
		}
		.suc-title {
			font-size: 36rpx;
			font-weight: 600;
			color: #292929;
			line-height: 48rpx;
		}
	}
	
	.row-box {
		
		border-top: 2rpx solid #E8EDF5;
		.row-wrap {
			padding-top: 32rpx;
			display: flex;
			font-size: 26upx;
			.name {
				width: 160upx;
				color: #92969E;
			}
			.num {
				width: 550rpx;
				color: #292929;
				white-space: pre-line;				word-wrap:break-word;
			}
		}
	}
	
	.content-btn {
		padding: 58upx 0px 34upx;
	}
	
	.foo-tip {
		font-size: 24upx;
		color: #92969E;
		text-align: center;
	}
</style>
